<template>
    <div>
      <el-row v-for="i in rowNum" :key="'row-' + i">
        <el-col
          v-for="(item, index) in data" :key="'col-' + index"
          v-if="index < colNum * i && index >= colNum * (i - 1)"
          :span="24 / colNum"
        >
          <slot :data="item"></slot>
        </el-col>
      </el-row>
    </div>
  </template>
  
  <script>
  export default {
    name: 'Lattice',
    props: {
      rowNum: {
        type: Number,
        default: 1
      },
      colNum: {
        type: Number,
        default: 1
      },
      data: Array
    }
  }
  </script>
  